<ul>
<li><a href="javascript:void(0)" onclick="setBTime();"><b>Business Hours</b></a>  </li>
<li><a href="javascript:void(0)" onclick="setExTTime()"><b>Extended Hours</b></a>   </li>
</ul>
<div class="form">

    <?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'equipment-schedule-form',
    'enableAjaxValidation'=>false,
)); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>



    <div class="row">
        <?php echo $form->labelEx($model,'MonStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'MonStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
    ));?>
        <?php echo $form->error($model,'MonStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'MonEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'MonEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
     <?php echo $form->error($model,'MonEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'TueStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'TueStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'TueStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'TueEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'TueEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'TueEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'WedStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'WedStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
        <?php echo $form->error($model,'WedStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'WedEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'WedEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
        <?php echo $form->error($model,'WedEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'ThuStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'ThuStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
       ));?>
       <?php echo $form->error($model,'ThuStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'ThuEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'ThuEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
        <?php echo $form->error($model,'ThuEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'FriStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'FriStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'FriStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'FriEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'FriEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'FriEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'SatStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'SatStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'SatStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'SatEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'SatEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
        <?php echo $form->error($model,'SatEnd'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'SunStart'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'SunStart',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
         ));?>
        <?php echo $form->error($model,'SunStart'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'SunEnd'); ?>
        <?php $this->widget('CMaskedTextField',array(
        'model'=>$model,
        'attribute'=>'SunEnd',
        'mask'=>'99:99:99',
        'htmlOptions'=>array(
            'size'=>6,
            'class'=>'schschedule'
        )
        ));?>
        <?php echo $form->error($model,'SunEnd'); ?>
    </div>
 

    <?php $this->endWidget(); ?>

</div><!-- form -->
<script type="text/javascript">
    function setBTime(){
        var counter = 0;
        $("input.schschedule").each(function(){
            counter++;
            if(counter>10) return;
            if(counter % 2)
            $(this).val('08:00:00');
            else
                $(this).val('17:00:00');
            console.log(counter);
        })
    }
    function setExTTime(){
        var counter = 0;
        $("input.schschedule").each(function(){
            counter++;
            if(counter>12) return;
            if(counter % 2)
                $(this).val('08:00:00');
            else
                $(this).val('20:00:00');
            console.log(counter);
        })
    }
</script>